<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>车辆列表-增加</title>
	<link rel="stylesheet" type="text/css" href="../resource/css/base.css" />
	<script type="text/javascript" src="../resource/js/My97DatePicker/WdatePicker.js"></script>
	<s:actionmessage/>
	<script type="text/javascript"><!--
		function doSumbit(){
			var form = document.forms[0];
			if(form.truckId.value==""){
				alert("请输入车牌号.");
				return false;
			}
			if(form.truckType.value==""){
				alert("请选择车辆类型.");
				return false;
			}
			var pattern = /^[0-9]+(\.[0-9]{1,2}){0,1}$/;
			if(form.maxLoad.value==0||form.maxLoad.value==""){
				alert("请输入最大载重.");
				return false;
			}
			if (!pattern.test(form.maxLoad.value)){
				alert("最大载重信息格式有误,请填写数字.");
				return false;
			}
			if (!pattern.test(form.netryFee.value)){
				alert("购买金额信息格式有误,请填写数字.");
				return false;
			}
			form.action="add.action";
			form.submit();			
		}
	</script>
</head>
<body  oncontextmenu="return false;" leftmargin="8" topmargin="8">
<div class="tip"><span>当前位置:</span>车辆管理&nbsp;&gt;&nbsp;新增&nbsp;&gt;&nbsp;</div>
<s:form name="add" namespace="/truck">
<table class="edittb" cellpadding="2" cellspacing="1">
	<tr bgcolor="#EEF4EA">
		<td height="35" colspan="4">&nbsp;车辆信息&nbsp;</td>
	</tr>
	<tr>
		<td class="coln"><SPAN style="color: red">*</SPAN> 车牌号</td>
		<td width="35%" class="colv">
			<s:textfield name="truckId"></s:textfield>
		</td>
		<td class="coln">车别名</td>
		<td width="45%" class="colv">
			<s:textfield name="truckName"></s:textfield>
		</td>
	</tr>
	<tr>
		<td class="coln">品牌</td>
		<td width="35%" class="colv">
			<s:textfield name="truckBrand"></s:textfield>
		</td>
		<td class="coln">型号</td>
		<td width="45%" class="colv">
			<s:textfield name="truckModel"></s:textfield>
		</td>
	</tr>
	<tr>
		<td class="coln"><SPAN style="color: red">*</SPAN> 类型</td>
		<td width="35%" class="colv">
			<s:select list="paramter" listKey="id.paramKey" listValue="paramValue"  name="truckType" cssStyle="width:80%"></s:select>
		</td>
		<td class="coln"><SPAN style="color: red">*</SPAN> 最大载重 (kg)</td>
		<td width="45%" class="colv">
			<s:textfield name="maxLoad"></s:textfield> 
		</td>
	</tr>
	<tr>
		<td class="coln">购买日期</td>
		<td width="35%" class="colv">
			 <s:textfield onclick="WdatePicker();" cssClass="Wdate" name="netryTime"></s:textfield>
		</td>
		<td class="coln">购买金额</td>
		<td width="45%" class="colv">
			<s:textfield name="netryFee"></s:textfield>
		</td>
	</tr>
	<tr>
		<td class="coln">备注</td>
		<td width="35%" class="colv" colspan="3">
			<s:textarea name="note"></s:textarea>
		</td>
	</tr>
	
	<tr align="right" bgcolor="#EEF4EA">
		<td height="35" colspan="4" align="center">
			<a href="javascript:history.go(-1)" class="coolbg">&nbsp;返&nbsp;回&nbsp;</a>
			<a href="#" class="coolbg" onclick="return doSumbit();">&nbsp;保&nbsp;存&nbsp;</a>
			<a href="javascript:document.forms[0].reset()" class="coolbg">&nbsp;重&nbsp;置&nbsp;</a>
		</td>
	</tr>
</table>
</s:form>
</body>
</html>
